<?php
    header('Content-Type:text/html;charset=utf-8');
       if(isset($_POST['button'])){
           //echo 21;
               $username=$_POST['username'];
               $pwd=$_POST['password'];

               mysql_connect('localhost','root','') or die(mysql_error());
               mysql_select_db('zhudata') or die('数据库选择失败');
               mysql_query('set names utf8');

               $sql = "select * from userData where username='$username' and `password`='$pwd'";
               //echo $sql;
               $rs = mysql_query($sql);


               if(mysql_num_rows($rs)==1){
                   //echo "登录成功";
//                   header('location:admin.php');
                    echo 1;
               }else {

                    echo "登录失败";
               }
           }
?>
